﻿using System;
using System.Data;
using System.Data.OleDb;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Bass.Tools;
using System.IO;
using MySql.Data.MySqlClient;

public partial class noticeland : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //OleDbConnection Conn = new OleDbConnection();
        //Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Server.MapPath("miumiu.mdb");
        //Conn.Open();

        //取到连接字符串
        string propertiesPath = Server.MapPath("mysqldb.properties");
        mytools mt = new mytools();
        string ConnString = mt.getMysqlConn(propertiesPath);

        //打开连接
        MySqlConnection myConnection = new MySqlConnection(ConnString);
        myConnection.Open();


        MySqlDataAdapter da = new MySqlDataAdapter("select * from notice_info order by addtime desc", myConnection);
        DataSet ds = new DataSet();
        da.Fill(ds, "noticelist");
        Repeater2.DataSource = ds.Tables["noticelist"].DefaultView;
        Repeater2.DataBind();

        myConnection.Close();
    }

    protected string Substring(string str, int i, int j)
    {
        mytools mt = new mytools();
        string resultstr = mt.Substring(str, i, j);
        return resultstr;
    }

    protected string ReformDate(string addtime)
    {
        mytools mt = new mytools();
        string datereformed = mt.ReformDate(addtime);
        return datereformed;
    }

}
